using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Weazel.Toad.Application.Controls.WelcomeFillControl
{
  public partial class WelcomeFillControl : UserControl
  {
    private Image backImage;

    public WelcomeFillControl()
    {
      InitializeComponent();

      this.backImage = GraphicsLoader.LoadImage(GetType(), "welcome_background.png");
    }

    protected override void OnResize(EventArgs e)
    {
      Invalidate();
    }

    protected override void OnPaint(PaintEventArgs e)
    {
      Graphics g = e.Graphics;
      g.FillRectangle(Brushes.White, ClientRectangle);

      if (backImage != null)
      {
        g.DrawImage(
          backImage, 
          new Rectangle(Width - backImage.Width, Height - backImage.Height, backImage.Width, backImage.Height)
        );
      }
    }    
  }
}
